package com.chzn.factoryCreateBean;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description
 * @Author houchenkai
 * @Created Date: 2020/11/2 11:42
 * @ClassName
 */
public class StaticCityFactory {

	private static Map<String, City> cities;

//	static {
//		cities = new HashMap<String, City>();
//		cities.put("BJ", new City("北京", "BJ"));
//		cities.put("SH", new City("上海", "SH"));
//		cities.put("CD", new City("成都", "CD"));
//		cities.put("SZ", new City("深圳", "SZ"));
//	}

	public static City getCity(String code) {
		return cities.get(code);
	}

}
